Method and device for switching playing mode of a mobile terminal, storage medium and program

ABSTRACT

Disclosed is a method and device for switching a playing mode of a mobile terminal, a storage medium and a program, including creating a full screen blank view and creating a full screen playing view, so that the full screen playing view covers the full screen blank view; loading a video content to be played into the full screen playing view; and after a rotation angle of a mobile terminal is received, rotating the video content which is loaded into the full screen playing view, and playing the rotated video content in the full screen playing view. By switching a playing mode of a mobile terminal, a non-full screen mode in a vertical screen form is switched to a full screen mode in a horizontal screen form; and a video content does not need to be recomposed any longer, thereby reducing hardware resources consumption and accelerating the switching process.

TECHNICAL FIELD

The present invention relates to the technical field of informationprocessing, and more particularly to a method for switching playing modeof a mobile terminal and the device thereof.

BACKGROUND ART

Today, the performance of a mobile terminal is increasingly improved.Users can access a browser via a mobile terminal, and then use thebrowser to play online video directly.

When using a mobile terminal to play an online video, the defaultplaying mode is typically a non-full-screen mode. In suchnon-full-screen mode, the online video is usually played in a vertical(portrait) style. Accordingly, in order to improve the visualexperience, users are more likely to watch the online video in a fullscreen mode. In the full screen mode, an online video is usually playedin a horizontal (landscape) style. As a result, in order to watch anonline video in a full screen mode in a horizontal (landscape) style,the mobile terminal needs to switch from the non-full-screen mode to thefull screen mode, as well as switch from vertical style to thehorizontal style, such that switch from the non-full-screen mode invertical style to the full screen mode in horizontal style. In theexisting technology available in the art, when switching the playingmode of a mobile terminal, the view of a video needs to be separatedfrom the WebView and then placed to a full screen view, and the wholeWebView needs to be rotated to a horizontal displaying style accordingto the orientation of activity. In this way, the video is now played ina horizontal full screen mode, which takes full advantages of the entirescreen area. However, in such method, due to the rotation of WebView,the browser kernel needs to reformat. In addition, after the full screenplaying is finished, the WebView will returns back to thenon-full-screen mode. Accordingly, the WebView makes another switch fromthe horizontal style to the vertical style; and as a result, the browserkernel needs to reformat again. It is noted that the browser kernelreformatting needs to recalculate the coordinate and size of eachwebpage element. Therefore, in the case of switching between horizontaland vertical style, the browser kernel needs to conduct a reformattingprocess that will take up a lot of CPU and other hardware resources, andthus further leading to a slower switching speed, Moreover, during thecourse of reformatting, users will see a messy webpage, which leads to apoor user experience.

SUMMARY OF THE INVENTION

The embodiments of the present application disclose a method forswitching playing mode of a mobile terminal. This method comprises,firstly, creating a full screen blank view, and creating a full screenplaying view, so that the full screen playing view covers the fullscreen blank view; and then loading a video content to be played to thefull screen playing view; according to a received rotation angle of amobile terminal, rotating the video content which has been loaded to thefull screen playing view, and then playing the rotated video content inthe full screen playing view.

In another aspect of the embodiments of the present invention, a devicefor switching playing mode of a mobile terminal has also been disclosed,which comprises one or a plurality of processors, and one or a pluralityof memories that stores computer executable instructions; when theexecutable instructions are executed, the one or a plurality ofprocessors perform the following steps: creating a full screen blankview, and creating a full screen playing view, so that the full screenplaying view covers the full screen blank view; and then loading a videocontent to be played to the full screen playing view; [05] according toa received rotation angle of a mobile terminal, rotating the videocontent which has been loaded to the full screen playing view, and thenplaying the rotated video content in the full screen playing view.

In yet another aspect of the embodiments of the present invention, acomputer readable medium that contains processor executable program codeis provided, which can be applied in a mobile terminal. The program codeenables a processor to perform the following steps: creating a fullscreen blank view, and creating a full screen playing view, so that thefull screen playing view covers the full screen blank view; and thenloading a video content to be played to the full screen playing view;according to a received rotation angle of a mobile terminal, rotatingthe video content which has been loaded to the full screen playing view,and then playing the rotated video content in the full screen playingview.

Lastly, the embodiments of the present invention further provide aprogram for switching playing mode of a mobile terminal, which comprisesthe steps of the foregoing method.

By virtue of rotating video content, the method for switching playingmode of a mobile terminal provided in the present invention is able toachieve switching playing mode of a mobile terminal in which a verticalstyle non-full-screen mode is switched to a horizontal style full screenmode. In addition, during the switching process, due to the fact thatwhat has been changed is the rendering direction of the video content inthe full screen playing view, the browser does not need to reformat thewebpage anymore, which helps to reduce the consumption on CPU and otherhardware resources resulting from the browser kernel reformatting thecurrent video page, and thereby accelerating the switching process andmore smoothly plating the video.

Furthermore, in the existing technology currently available in the art,video screen switching may lead to corrupted content displayed on thescreen when the WebView displays the content of the current video page,which would significantly affect user experience. While the presentapplication does not need reformatting, and accordingly, no corruptedcontent will be displayed on the screen, which helps to improve userexperience.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to more clearly describe the technical solutions provided inthe embodiments of the present invention or in the existing technologiesin the art, the drawings used in the descriptions for in the embodimentsof the present invention or the existing technologies in the art will bebriefly described next. Obviously, the drawings in the followingdescription are only a few exemplary embodiments of the presentinvention. A person of ordinary skill in the art is able to know thatother drawings could be easily obtained based on the drawings providedbelow with no need of any creative work.

FIG. 1 is a flow chart of one exemplary embodiment of the method forswitching playing mode of a mobile terminal provided in the presentinvention.

FIG. 2(a) is a schematic view of the screen in the non-full-screen modeof a mobile terminal.

FIG. 2(b) is a schematic view of the screen in the full screen mode of amobile terminal according to the method for switching playing mode of amobile terminal disclosed in the present invention.

FIG. 2(c) is another schematic view of the screen in the full screenmode of a mobile terminal according to the method for switching playingmode of a mobile terminal disclosed in the present invention.

FIG. 3 is a flow chart of another exemplary embodiment of the method forswitching playing mode of a mobile terminal provided in the presentinvention.

FIG. 4 is a schematic view of a mechanism of loading video content forthe method for switching playing mode of a mobile terminal provided inthe present invention.

FIG. 5 is a schematic view of another mechanism of loading video contentfor the method for switching playing mode of a mobile terminal providedin the present invention.

FIG. 6 is a flow chart of another exemplary embodiment of the method forswitching playing mode of a mobile terminal provided in the presentinvention.

FIG. 7 is a flow chart of another exemplary embodiment of the method forswitching playing mode of a mobile terminal provided in the presentinvention.

FIG. 8 is a flow chart of another exemplary embodiment of the method forswitching playing mode of a mobile terminal provided in the presentinvention.

FIG. 9 is a block diagram of one exemplary embodiment of the device forswitching playing mode of a mobile terminal provided in the presentinvention.

FIG. 10 is a block diagram of another exemplary embodiment of the devicefor switching playing mode of a mobile terminal provided in the presentinvention.

FIG. 11 is a flow chart of a method for improving graphics renderingefficiency according to an exemplary embodiment of the presentinvention.

FIG. 12 is a flow chart of a method for improving graphics renderingefficiency according to another exemplary embodiment of the presentinvention.

FIG. 13 is a flow chart of a method for improving graphics renderingefficiency according to another exemplary embodiment of the presentinvention.

FIG. 14 is a flow chart of a method for improving graphics renderingefficiency according to another exemplary embodiment of the presentinvention.

DESCRIPTION OF THE EMBODIMENTS

The following embodiments of the present invention provide a method anddevice for switching playing mode of a mobile terminal, which help tosolve the technical problem that when switching the playing mode of amobile terminal, the video content needs to be reformatted, which wouldconsume a great deal of time and resources, and, accordingly, compromisethe view content displaying.

In order to enable those skilled in the art to better understand thetechnical solutions provided in the embodiments of the presentinvention, as well as to make the objects, features and advantages ofthe embodiments of the present invention more easily understood, thetechnical solutions provided in the embodiments of the present inventionwill be further described in details in reference to the accompanyingdrawings.

In reference to the schematic view of the flow chart of the method shownin FIG. 1, the method for switching playing mode of a mobile terminalprovided in one embodiment of the present invention comprises the stepsas follows:

Step 11, creating a full screen blank view, and creating a full screenplaying view, so that the full screen playing view covers the fullscreen blank view.

In the case when a user needs to play an online video, the defaultplaying model of a mobile terminal is typically a non-full-screen mode.In such a case, if the user selects to play the online video in a fullscreen mode, the mobile terminal needs to switch its playing mode. Inthe method for switching playing mode of a mobile terminal provided inthe present invention, following creating a full screen blank view, afull screen playing view needs to be further created, and the fullscreen playing view needs to cover the full screen blank view.

Step 12, acquiring a video content to be played, and then loading thevideo content to be played to the full screen playing view.

Step 13, according to a received rotation angle of a mobile terminal,rotating the video content which has been loaded to the full screenplaying view, for example, changing the orientation of the video contentby way of changing the rendering direction of the video content in thefull screen playing view, and then playing the rotated video content inthe full screen playing view. Preferably, according to a receivedrotation angle of a mobile terminal, rotate the video content which hasbeen loaded to the full screen playing view.

As for the specific value of the rotation angle of a mobile terminal, itcould be determined according to the user's viewing requirement. Due tothe fact that in a non-full-screen mode, the video content is usuallyplayed in a vertical style, while in a full screen mode, the videocontent is usually played in a horizontal style, in order to achieve theswitching from the video content in the vertical style to that in thehorizontal style, the rotation angle of a mobile terminal is usually90±360 degrees or 270±360 degrees. Of course, based on the user'sviewing requirement, the rotation angle of a mobile terminal can be anyother values. There is no any limitation to this value in the presentinvention.

In reference to the schematic views of the screen of a mobile terminalshown in FIGS. 2(a) to 2(c), the playing mode shown in FIG. 2(a) is anon-full-screen mode; in such a case, the video content is displayed ina vertical style. In addition, the playing mode shown in FIG. 2(b) is afull screen mode; in such a case, the video content has a rotation basedon the rotation angle of a mobile terminal, and the rotation angle of amobile terminal is usually 90±360 degrees. As a result, the videocontent is displayed in the full screen playing view in a horizontalstyle. Moreover, the playing mode shown in FIG. 2(c) is a full screenmode as well. In such a case, in certain embodiments of the presentinvention, the video contents have a rotation based on the rotationangle of a mobile terminal, and the rotation angle of a mobile terminalis usually 270±360 degrees. As a result, the video content is displayedin the full screen playing view in a horizontal style.

Some embodiments of the present invention provide a method for switchingplaying mode of a mobile terminal. This method comprises the followingsteps: firstly, creating a full screen blank view, and creating a fullscreen playing view, so that the full screen playing view covers thefull screen blank view; and then loading a video content to be played tothe full screen playing view; according to a received rotation angle ofa mobile terminal, rotating the video content which has been loaded tothe full screen playing view, and then playing the rotated video contentin the full screen playing view.

By virtue of rotating video content, the method for switching playingmode of a mobile terminal provided in the present invention is able toachieve switching playing mode of a mobile terminal, in which a verticalstyle non-full-screen mode is switched to a horizontal style full screenmode. In addition, during the switching process, due to the fact thatwhat has been changed is the rendering direction of the video content inthe full screen playing view, the browser does not need to reformat thewebpage anymore, which helps to reduce the consumption on CPU and otherhardware resources resulting from the browser kernel reformatting thecurrent video page, and thereby accelerating the switching process andmore smoothly plating the video.

Moreover, in the existing technology currently available in the art,video screen switching may lead to a corrupted content displayed on thescreen when the WebView displays the content of the current video page,which would significantly affect user experience. While the presentapplication does not need reformatting, and accordingly, no corruptedcontent will be displayed on the screen, which helps to improve userexperience.

In reference to FIG. 3, the method for switching playing mode of amobile terminal provided in the present invention further comprises:

Step 14, according to the rotation angle of a mobile terminal, rotatingthe video control bar.

In the description provided above and the work flow shown in FIG. 3,after finishing the operation of step 13, that is to say, aftercompletion of rotating the video content, the video control bar will berotated as well. In practice, the step of rotating the video control barmay also be carried out prior to rotating the video content, or at thesame time with rotating the video content. That is to say, there is nolimitation to this step in this application.

The rotation angle of the video control bar is the same as the rotationangle of the video content. In this way, it can facility the user tolearn the playing progress of the video content while the user isviewing the video content in a full screen mode.

On the other hand, in order to avoid switching errors, a determinationoperation could be performed between steps 12 and step 13. Thisoperation determines whether the video content loaded to the full screenplaying view is in a vertical style, if it is yes, then according to therotation angle of a mobile terminal, rotate the video content which hasbeen loaded to the full screen playing view, so as to achieve a switchfrom the vertical style to the horizontal style; while if it is no, thenit indicates that the current video content is already in a horizontalstyle, which can be played directly without a rotation.

In the step 12, it has disclosed a step of loading the video content tobe played to the full screen playing view. This step may be implementedby way of a variety of different approaches. In reference to FIG. 4, inone of the implementation approach, the step of loading the videocontent to be played to the full screen playing view comprises:

Step 121, establish a connection between the player and the full screenplaying view by way of a player interface.

Step 122, obtain the video content to be played contained in the playervia the connection, and then load the video content to be played to thefull screen playing view.

In the technical solution disclosed in the step 121 and step 122, aconnection between the player and the full screen playing view is firstset up via a player interface; subsequently the video content containedin the player is obtained and then loaded to the full screen playingview.

Optionally, in reference to FIG. 5, in another approach ofimplementation, the step of loading the video content to be played tothe full screen playing view comprises:

Step 123, save the video content to be played contained in the playerinto a cache.

Step 124, duplicate the video content to be played that has been savedin the cache, and then load the duplicated video content to the fullscreen playing view.

By way of the technical solution disclosed in the step 123 and step 124,the video content to be played has been loaded to the full screenplaying view.

Furthermore, some embodiments of the present invention also provide amethod for switching playing mode of a mobile terminal. In reference toFIG. 6, the method for switching playing mode of a mobile terminalcomprises:

Step 21, creating a full screen blank view, and creating a full screenplaying view, so that the full screen playing view covers the fullscreen blank view.

Step 22, loading a video content to be played to the full screen playingview.

Step 23, according to a received rotation angle of a mobile terminal,rotating the video content which has been loaded to the full screenplaying view, for example, changing the orientation of the video contentby way of changing the rendering direction of the video content in thefull screen playing view, and then playing the rotated video content inthe full screen playing view.

Step 24, according to the rotation angle of a mobile terminal, rotatingthe video control bar.

The implementation process of the steps from 21 to 24 is the same as theimplementation process of the steps from 11 to 14. According, thepreviously described implementation process can be used as a reference,and the specific procedures will not be repeated again here.

Step 25, after completion of playing the video content, deleting thefull screen playing view.

In this process, after completion of playing the video content, the fullscreen playing view is deleted, in order to avoid the issue in theexisting technology in the art, in which when the playing mode isswitched to a full screen mode, after completion of playing the videocontent, the browser needs to reformat the WebView of the webpage thatcontains the current video.

In the method for switching playing mode of a mobile terminal disclosedin the embodiment of the present invention, after completion of playingthe video content, the full screen playing view is deleted. As a result,the present invention does not need a reformatting process, which helpsto reduce the consumption on CPU and other hardware resources, andthereby accelerating the switching process and more smoothly plating thevideo and reducing the time for switching. The foregoing process canhelp the user to perform other operations to the mobile terminal. Inaddition, since the present application does not need reformatting, andaccordingly, no corrupted content will be displayed on the screen, whichhelps to improve user experience.

For easily understanding the present invention, the method for switchingplaying mode of a mobile terminal disclosed in the embodiment of thepresent invention will be further described in details through twospecific embodiments of the present invention.

In the first embodiment of the present invention, in reference to FIG.7, the method comprises the steps of:

Step 31, creating a full screen blank view, and creating a full screenplaying view, wherein the full screen playing view is a TextureView, andthe TextureView covers the full screen blank view.

Step 32, by way of calling the player interface, establishing aconnection between the TextureView and the player, and then loading thevideo content to be played in the player to the TextureView.

Step 33, acquiring the rotation angle of a mobile terminal that has beenset up in the Matrix class, and then according to the rotation angle ofa mobile terminal, rotating the video content by way of changing therendering direction of the video content in the TextureView, and nextplaying the rotated video content in the TextureView.

In the foregoing step, the rotation angle of a mobile terminal that hasbeen set up in the Matrix class is typically 90±360 degrees or 270±360degrees. Of course, the rotation angle of a mobile terminal can be anyother values set by the user. There is no any limitation to this valuein the present invention. In addition, the Matrix class in the presentinvention is used to provide the rotation angle of a mobile terminalneeded in rotation of the video content. Moreover, the Matrix class maybe created after loading the video content to the TextureView;alternatively, it may be created prior to the step 32. There is no anylimitation to it in the present invention.

In addition, the method for switching playing mode of a mobile terminaldisclosed in this embodiment of the present invention further comprises:

Step 34, using the setRotate function to rotate the video control bar,and the rotation angle of the video control bar is the same as therotation angle of a mobile terminal.

In the description provided above and the work flow shown in FIG. 7,after completion of rotating the video content, the video control barwill be rotated. However, in practice, the step of rotating the videocontrol bar may also be carried out prior to rotating the video content,or at the same time with rotating the video content. That is to say,there is no limitation to this step in this application.

In the second embodiment of the present invention, in reference to FIG.8, the method comprises the steps of:

Step 41, creating a full screen blank view, and creating a full screenplaying view, wherein the full screen playing view is a GLSurfaceView(OpenGL Surface View), and the GLSurfaceView covers the full screenblank view.

Step 42, saving the video content to be played contained in the playerinto a cache, and then duplicating the video content to be played thathas been saved in the cache, next loading the duplicated video contentto the GLSurfaceView.

Step 43, acquiring the rotation angle of a mobile terminal that has beenset up in the Matrix class, and then according to the rotation angle ofa mobile terminal, rotating the video content, and next playing therotated video content in the GLSurfaceView.

In the foregoing step, the rotation angle of a mobile terminal that hasbeen set up in the Matrix class is typically 90±360 degrees or 270±360degrees. Of course, the rotation angle of a mobile terminal can be anyother values set by the user. There is no any limitation to this valuein the present invention. In addition, the Matrix class in the presentinvention is used to provide the rotation angle of a mobile terminalneeded in rotation of the video content. Moreover, the Matrix class maybe created after loading the video content to the TextureView;alternatively, it may be created prior to the step 32. There is no anylimitation to it in the present invention.

In addition, the method for switching playing mode of a mobile terminaldisclosed in this embodiment of the present invention further comprises:

Step 44, using the setRotate function to rotate the video control bar,and the rotation angle of the video control bar is the same as therotation angle of a mobile terminal.

In the description provided above and the work flow shown in FIG. 8,after completion of rotating the video content, the video control barwill be rotated. However, in practice, the step of rotating the videocontrol bar may also be carried out prior to rotating the video content,or at the same time with rotating the video content. That is to say,there is no limitation to this step in this application.

In the foregoing two embodiments of the present invention, the methodfor switching playing mode of a mobile terminal of the present inventionhas been respectively described in the cases when the full screenplaying view is TextureView or GLSurfaceView. Due to the fact that whenthe two embodiments switch playing mode they do not need to reformattheir current webpage, they are able to reduce the consumption on theCPU and other hardware resources resulting from the reformattingprocess, and thereby accelerating the switching process and reducing thetime for switching playing mode when playing a video in the browser.Furthermore, since the present application does not need reformatting,and accordingly, no corrupted content will be displayed on the screen,which helps to improve user experience.

Correspondingly, the present invention also discloses a device forswitching playing mode of a mobile terminal. In reference to FIG. 9, thedevice for switching playing mode of a mobile terminal comprises: acreation module 100, a loading module 200 and a first rotation module300.

In the foregoing device, the creation module 100 is used for creating afull screen blank view, and creating a full screen playing view, so thatthe full screen playing view covers the full screen blank view.

The loading module 200 is used for loading a video content to be playedto the full screen playing view.

The first rotation module 300 is used for rotating the video contentwhich has been loaded to the full screen playing view according to areceived rotation angle of a mobile terminal, and then playing therotated video content in the full screen playing view.

Moreover, in reference to FIG. 10, the device for switching playing modeof a mobile terminal further comprises a second rotation module 400,wherein the second rotation module 400 is used for, according to areceived rotation angle of a mobile terminal, rotating the video controlbar.

The loading module 200 may be in a plurality of different forms. In oneof its implementation forms, the loading module 200 may comprise aconnection unit and a first loading unit.

In the foregoing structure, the connection unit is used for establishinga connection between the player and the full screen playing view via theplayer interface.

The first loading unit is used for obtaining the video content to beplayed that is contained in the player through the foregoing connection,and then loading the video content to be played to the full screenplaying view.

In another implementation form, the loading module 200 may comprise astorage unit and a second loading unit.

In the foregoing structure, the storage unit is used for saving thevideo content to be played that is contained in the player to the cache.

The second loading unit is used for duplicating the video content to beplayed that is saved in the cache, and then loading the duplicated videocontent to be played to the full screen playing view.

Moreover, the device for switching playing mode of a mobile terminalcomprises: a deletion module, wherein the deletion module is used fordeleting the full screen playing view after completion of playing thevideo content.

In addition, the rotation angle of a mobile terminal is usually 90±360degrees or 270±360 degrees.

Correspondingly, the present invention also discloses a computerreadable medium that contains processor executable program code, whichmay be applied in certain electronic devices. In an execution process,the program code makes the processor execute the steps as follows:

creating a full screen playing view, so that the full screen playingview covers the full screen blank view;

loading a video content to be played to the full screen playing view;

according to a received rotation angle of a mobile terminal, rotatingthe video content which has been loaded to the full screen playing view,and then playing the rotated video content in the full screen playingview.

Optionally, the program code makes the processor further execute thesteps as follows:

according to a received rotation angle of a mobile terminal, rotatingthe video control bar.

Optionally, the step of loading the video content to be played to thefull screen playing view comprises:

establishing a connection between the player and the full screen playingview via the player interface;

and then obtaining the video content to be played that is contained inthe player through the foregoing connection, and then loading the videocontent to be played to the full screen playing view.

Optionally, the step of loading the video content to be played to thefull screen playing view may also comprise:

saving the video content to be played that is contained in the player tothe cache;

and then duplicating the video content to be played that is saved in thecache, and next load the duplicated video content to be played to thefull screen playing view.

Optionally, the program code makes the processor further execute thesteps as follows: deleting the full screen playing view after completionof playing the video content.

Optionally, the rotation angle of a mobile terminal is usually 90±360degrees or 270±360 degrees.

FIG. 11 is a flow chart of a method for improving graphics renderingefficiency according to an exemplary embodiment of the presentinvention. The method can be applied to a wide variety of differentterminal devices, such as mobile phone, tablet computer, PC (personalcomputer) and the like. In reference to FIG. 11, the method comprisesthe steps as follows:

S101, acquire the display attributes for each node on the image of thecurrent frame.

A drawing program, such as an HTML5-based game engine, usually makes thedrawing based on the nodes on the image. An image corresponds to arendering tree, wherein the rendering tree has a root and numerousbranches, and the root and the branches can be referred to as thegraphic nodes, or simply nodes.

A graphic node has a display attribute. In this embodiment or otherembodiments of the present invention, the display attribute of a nodemay comprise one or a plurality of the following elements: x coordinateof the node, y coordinate of the node, width of the node, height of thenode, rotation angle of the node, inclination angle of the node,transparency of the node, visibility of the node, and color of the node.

The display attribute of a graphic node may be changed by otherapplications, which may result in a change in the image. By way oftraversing each node and executing certain operations of updating thedisplay attribute, a drawing program is able to obtain the displayattribute of each node in the current frame of image.

S102, detect a change from the display attributes of the nodes in theprevious frame of image to the display attributes of the nodes in thecurrent frame of image.

In this embodiment of the present invention, after obtaining the displayattributes of the nodes in the current frame of image, it does notdirectly redraw the image based on the new display attributes, rather,it firstly detects a change from the display attributes of the nodes inthe previous frame of image to the display attributes of the nodes inthe current frame of image, and then makes the decision about whether aredrawing is needed.

In this embodiment or certain other embodiments of the presentinvention, the display attributes of nodes may change, and the changeincludes:

Any element in any node changes.

That is to say, as long as a change in an element of a node has beendetected, it is able to reach the conclusion that the display attributesof nodes change. On the contrary, in the case when no any change can bedetected for any element in any node, it is able to reach the conclusionthat the display attributes of nodes have no change.

S103, only when it detects that the display attribute of a node has beenchanged, the present invention will make a redrawing to an image basedon the display attributes of each node. In addition, for the following afirst pre-determined number of frames, the respective image will bedirectly redrawn based on the obtained display attributes of each nodeafter obtaining the display attributes of each node.

For each frame of image, with the addition of the operation of detectingwhether the display attributes of its nodes have been changed, it isable to reduce the number of redrawing; however, on the other hand, itmay result in certain drawbacks as well. Since each time (in otherwords, each frame) needs to be detected, it will result in a largeamount of detections, which may compromise the image drawing efficiency.Therefore, in the step of S103, following a detection of a change in thedisplay attribute of a node(s), in addition to redrawing the currentframe of image, the present will also directly redraw each frame ofimage of the following a first pre-determined number of frames of imagewithout further detecting whether the display attributes of their nodeshave been changed. In this way, it is able to reduce the amount ofdetection for whether the display attributes of nodes have been changed,and thus further improve the drawing efficiency, and reduce unnecessaryconsumption on CPU and other resources.

In reference to FIG. 12, in this embodiment or certain other embodimentsof the present invention, for the subsequent first pre-determined numberof frames, following the step of redrawing the image directly based onthe display attributes of the nodes after obtaining the displayattributes of the nodes, they may have the following steps:

Return to the step of acquiring the display attributes for each node onthe image of the current frame; in other words, return to the step 101.

The steps S101 to S103 can be cycled in a loop to make a continuousdrawing.

Further, in reference to FIG. 13, in this embodiment or certain otherembodiments of the present invention, after the step of detecting apotential change between the display attributes of the nodes in thecurrent frame of image and the display attributes of the nodes in theprevious frame of image, the method may further comprise:

S104, upon detection of no change in the display attributes of eachnode, the present invention will not perform the step of redrawing basedon the display attributes of the nodes; rather it will return to thestep of acquiring the display attributes for each node on the image ofthe current frame; in other words, return to the step 101.

In this way, no redrawing will be performed upon detection of no changein the display attributes of each node. As a result, it is able toreduce the number of redrawing and thus improve the drawing efficiency,as well as reduce unnecessary consumption on CPU and other resources.

In addition, the method may further include:

For a continuous second pre-determined number of frames, in the casewhen the display attributes of nodes have no change in each detection,in the following pre-determined length of time, directly redraw theimage based on the obtained display attributes of nodes after obtainingthe display attributes of nodes.

Next, return to the step of acquiring the display attributes for eachnode on the image of the current frame.

In this way, the amount of detections, whether the display attributes ofnodes have been changed, can be further reduced. As a result, thedrawing efficiency has been further improved.

In reference to a specific scenario, the present invention will befurther described in detail.

FIG. 14 is a flow chart of a method for improving graphics renderingefficiency according to another exemplary embodiment of the presentinvention. In this case scenario, JavaScript can draw images in thebrowser based on the drawing interface provided by Canvas. Its framerate is 35 frames per second, and the interval between each frame is1/35 second, that is to say, a redrawing to the image may be performedevery 1/35 seconds.

S401, traversing each node, and during the traversing process, obtainingthe display attribute of each node; in addition, the display attributeof each node may be changed by other application programs, for example,an application program may change the x-axis coordinate value of a nodeby way of using JavaScript to call setX. In addition, by way ofexecuting an updating operation, it is able to obtain the displayattribute of each node in the current frame of image.

S402, determine whether the display attribute of node has been changed;and if the display attribute of a node has been changed, enter the stepS404, otherwise, enter the step S403.

S403, wait for 1/35 seconds, and then jump back to the step S401. Thatis to say, wait for the next frame, and then determine whether the nextframe needs to be redrawn.

S404, call the Canvas graphic interface, according to the displayattributes of each node redraw the image.

S405, wait for 1/35 seconds.

S406, traverse each node, and during the traversing process, obtainingthe display attribute of each node.

S407, call the Canvas graphic interface, according to the displayattributes of each node redraw the image. In this case, it does notperform the determination on whether the display attribute of node hasbeen changed.

S408, determine whether the N frames of image have been redrawn byexecuting the step S407. That is to say, if N number of redrawings havebeen performed after the step S404. The specific value of N may bedetermined according to specific situation.

If it is Yes, proceed to the step S409; if it is No, jump back to thestep S405.

S409, wait for 1/35 seconds, and then jump back to the step S401. Thatis to say, start a new cycle.

In this embodiment, before performing a redrawing, it first detectswhether the display attributes of nodes have been changed, and onlyperform the redrawing when it has detected that the display attribute ofa nodes has been changed. More importantly, in order to reduce theamount of detections, as a default, the following a series of frames ofimages will be redrawn directly without detection. In this way, thedrawing method provided in this embodiment is able to not only reducethe number of redrawings, but also reduce the amount of detections onwhether the display attributes of nodes have been changed. As a result,it is able to reduce the number of redrawing and thus improve thedrawing efficiency, as well as reduce unnecessary consumption on CPU andother resources.

Those skilled in the art can clearly understand that the technologydisclosed in the embodiments of the present invention can be implementedby software plus a necessary universal hardware platform. Based on thisunderstanding, the technical solution of the present invention isessentially, or the part contributing to the prior art may be embodiedin, the form of a software product. The computer software product may bestored in a storage medium, such as ROM/RAM, a magnetic disk, opticaldisk, which include a number of instructions to make a computer device(a personal computer, server, or network equipment) perform the methodof the embodiments of the present invention, or some portions of theembodiments of the present invention.

The embodiments of the present invention in the Description aredescribed in a progressive way. The same or similar parts of the variousembodiments may be used as reference to others. What have beenspecifically described in each embodiment are its differences from otherembodiments of the present invention. In particular, as for the systemembodiment, since it is substantially similar to the method embodiments,its description is relatively simple. Please refer to the related partsin the method embodiments for more details.

The embodiments of the invention described above are not intended tolimit the scope of the present invention. Any modifications, equivalentreplacement and improvement within the spirit and principles of thepresent invention should be included within the scope of the presentinvention.

1. A method for switching a playing mode of a mobile terminal, themethod comprising: creating a full screen blank view; creating a fullscreen playing view, wherein the full screen blank view is covered bythe full screen playing view; loading a video content to be played tothe full screen playing view; according to a rotation angle of themobile terminal, rotating the video content which has been loaded to thefull screen playing view; and playing the rotated video content in thefull screen playing view.
 2. The method according to claim 1, furthercomprising: according to the rotation angle of the mobile terminal,rotating a video control bar.
 3. The method according to claim 1,wherein loading the video content to be played to the full screenplaying view comprises: establishing a connection between a player andthe full screen playing view by way of a player interface; obtaining thevideo content to be played contained in the player via the connection;and loading the video content to be played to the full screen playingview.
 4. The method according to claim 1, wherein loading the videocontent to be played to the full screen playing view comprises: savingthe video content to be played contained in the player into a cache;duplicating the video content to be played that has been saved in thecache; and loading the duplicated video content to the full screenplaying view.
 5. The method according to claim 1, further comprising:after completion of playing the rotated video content, deleting the fullscreen playing view.
 6. The method according to claim 1, wherein therotation angle of a mobile terminal is one of 90+360 degrees, 90-360degrees, 270+360 degrees and 270-360 degrees.
 7. The method according toclaim 1, wherein, loading the video content to be played to the fullscreen playing view comprises: rotating a rendering direction of thevideo content in the full screen playing view.
 8. The method accordingto claim 7, wherein, when a horizontal displaying mode is needed, themethod further comprises: determining whether the video content to bedisplayed is in a horizontal style or a vertical style; and based onvideo content to be displayed is in the vertical style, after obtainingthe rotation angle for the full screen playing view, rotating therendering direction of the video content in the full screen playingview, so as to display the video content in the horizontal style in thefull screen playing view.
 9. A device for switching a playing mode of amobile terminal, comprising one or more processors and one or morememories for saving computer-executable instructions, wherein, when theexecutable instructions are executed by the one or more processors, theone or more processors are configured to perform the following: creatinga full screen blank view; creating a full screen playing view, whereinthe full screen blank view is covered by the full screen playing view;loading a video content to be played to the full screen playing view;according to a rotation angle of the mobile terminal, rotating the videocontent which has been loaded to the full screen playing view; andplaying the rotated video content in the full screen playing view. 10.The device according to claim 9, wherein the one or more processors arefurther configured to execute the executable instructions to perform:according to the rotation angle of the mobile terminal, rotating a videocontrol bar.
 11. The device according to claim 9, wherein, when loadingthe video content to be played to the full screen playing view, the oneor more processors are further configured to execute the executableinstructions to perform: establishing a connection between a player andthe full screen playing view by way of a player interface; obtaining thevideo content to be played contained in the player via the connection;and loading the video content to be played to the full screen playingview.
 12. The device according to claim 9, wherein, when loading thevideo content to be played to the full screen playing view, the one ormore processors are further configured to execute the executableinstructions to perform: saving the video content to be played containedin the player into a cache; duplicating the video content to be playedthat has been saved in the cache; and loading the duplicated videocontent to the full screen playing view.
 13. The device according toclaim 9, wherein the one or more processors are further configured toexecute the executable instructions to perform: after completion ofplaying the rotated video content, deleting the full screen playingview.
 14. The device according to claim 9, wherein the rotation angle ofa mobile terminal is one of 90+360 degrees, 90-360 degrees, 270+360degrees and 270-360 degrees.
 15. A computer readable medium that has aprocessor executable program code, which can be applied to a mobileterminal, characterized in that the program code is configured to enablethe processor to execute the following: creating a full screen blankview; creating a full screen playing view, wherein the full screen blankview is covered by the full screen playing view; loading a video contentto be played to the full screen playing view; according to a rotationangle of the mobile terminal, rotating the video content which has beenloaded to the full screen playing view; and playing the rotated videocontent in the full screen playing view.
 16. A program for switching aplaying mode of a mobile terminal, comprising the steps set forth in themethod according to claim 1.